/*
 * @Author: your name
 * @Date: 2020-12-18 09:54:44
 * @LastEditTime: 2021-01-18 10:38:55
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web-node-service\routes\login.js
 */
const router = require('koa-router')();
const userModels = require('../model/users');

router.post('/register', async (ctx) => {
	await userModels.register(ctx);
});
router.post('/login', async (ctx) => {
	await userModels.login(ctx);
});
router.post('/loginOut', async (ctx) => {
	await userModels.loginOut(ctx);
});
router.get('/captcha', async (ctx) => {
	await userModels.getCaptcha(ctx);
});
router.post('/edit/user', async (ctx) => {
	await userModels.editUser(ctx);
});

router.get('/user', async (ctx) => {
	await userModels.getUsers(ctx);
});

router.post('/del/user', async (ctx) => {
	await userModels.delUser(ctx);
});
module.exports = router;
